﻿Imports Entidades
Public Class frmAñadirFamilia
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Close()

    End Sub

    Private Sub btnAñadir_Click(sender As Object, e As EventArgs) Handles btnAñadir.Click
        If txtId.Text = "" Then
            MessageBox.Show("Introduce ID")
            Exit Sub
        End If
        If txtNombre.Text = "" Then
            MessageBox.Show("Introducr nombre")
            Exit Sub
        End If
        Dim st As String = miGestion.añadirFamilia(New Familia(txtId.Text, txtNombre.Text))
        If st <> "" Then
            MessageBox.Show(st)
            Exit Sub
        End If
        MessageBox.Show("Familia añadida correctamente")
    End Sub
End Class